<?php

use Biz\cache\lottery\CSpringHomeGift;

ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';

$config = [
//    '20220308' => ['f2','f2',144358,144358,144358,144358,144358,144358,144358,144358,144353,144353,144353,144353,144370,144370,144370],
    '20220309' => ['f2',144358,144358,144358,144358,144358,144358,144358,144358,144353,144353,144353,144353,144370,144370,144370],
//    '20220310' => ['f2','f2','f2',144358,144358,144358,144358,144358,144358,144358,144358,144353,144353,144353,144353,144370,144370,144370],
];

//检查配置
$configGifts = array_merge(...array_values($config));
$map = [];
foreach ($configGifts as $id) {
    $map[$id] = isset($map[$id]) ? $map[$id] + 1 : 1;
}
$list = \Biz\model\springHomeDecActivity\MSpringHomeDecProduct::dataSelect(['status' => 1]);

foreach ($list as $v) {
    echo $v['product_id'] . " 总共:" .  $v['total'] . " 剩余:" . $v['num'], " 配置:" . ($map[$v['product_id']] ?? 0) , PHP_EOL;
}







